package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class UC2Activity extends AppCompatActivity {

    private Button btnBack;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_uc2);

        // 初始化返回按钮
        btnBack = findViewById(R.id.btnBack);

        // 为返回按钮设置点击事件
        btnBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 创建一个意图，用于启动 MainActivity
                Intent intent = new Intent(UC2Activity.this, MainActivity.class);
                // 启动 MainActivity，返回主界面
                startActivity(intent);
            }
        });
    }
}